<?php
	class ExpireController extends Controller {
		public function index(){
			$expire = $this->loadModel("Expire");
            $expires = $expire->display();
            $this->set("title","SMECA - Expire List");
            $this->set("expires",$expires);
            $this->set("selectedMenu","EXP");
            $this->renderDefault("display","expire");
		}
		public function edit(){
		    $id = Basic::getVar("id");
			$this->set("title","SMECA - EXPIRE Edit");
            $expire = $this->loadModel("Expire");
            $this->set("expire",$expire->find($id));
            $this->set("selectedMenu","EXP");
            $this->renderDefault("edit","expire");
		}
		public function add(){
		    $this->set("title","SMECA - EXPIRE Add");
		    $this->set("selectedMenu","EXP");
			$this->renderDefault("add","expire");
		}
		public function editprocess(){
		    $expire = $this->loadModel("Expire");
            $expire->edit($_REQUEST["data"]);
            $this->redirect(array("com"=>"expire","action"=>"index"));
        }
		public function addprocess(){
			$expire = $this->loadModel("Expire");
            $expire->add($_REQUEST["data"]);
            $this->redirect(array("com"=>"expire","action"=>"index"));
		}
		public function delete(){
            $expire = $this->loadModel("Expire");
            $id = Basic::getVar("id");
            $expire -> delete($id);
            $this->redirect(array("com"=>"expire","action"=>"index"));
		}
	}
